package org.syncsoft.overalt.common.json;

/**
 * converter to integer
 * @author hfa
 *
 */
public class EntityCodeJsonConverter extends AbstractJsonConverter<Integer>{
	/*
	 * /(non-Javadoc)
	 * @see org.syncsoft.overalt.common.json.AbstractJsonConverter#converter(org.syncsoft.overalt.common.json.JSonTree)
	 */
	@Override
	protected Integer converter(JSonTree jsonTree) {
		String code = jsonTree.getParameterValue("key");
		return code != null ? Integer.parseInt(code) : -1;
	}
		
}
